﻿namespace TC
{
    public class SimpleParallel_tree : TranslateTree
    {
        public override editor.cfg.behaviourtree.TreeNode OnTranslate(Node node)
        {
            SimpleParallel t = node as SimpleParallel;
            editor.cfg.behaviourtree.SimpleParallel re = new editor.cfg.behaviourtree.SimpleParallel();
            re.id = t.id;

            Port p = t.graph.GetConnect(t.action);
            if(p != null)
            {
                re.actionNode = (editor.cfg.behaviourtree.Leaf)(BTGraphExport.translate[p.parent.GetType()].OnTranslate(p.parent));
            }
            p = t.graph.GetConnect(t.childTree);
            if(p != null)
            {
                re.parallel = BTGraphExport.translate[p.parent.GetType()].OnTranslate(p.parent);
            }
            return re;
        }
    }
}
